package com.tinem.platform.service.security.observable;

import com.tinem.platform.module.pojo.vo.security.verification.code.GenerateReq;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.context.ApplicationEvent;

import java.time.Duration;

/**
 * @author fzh
 * @version v1
 * @program: platform
 * @className GenerateObservable
 * @description TODO
 * @site 
 * @company 
 * @create 2020-09-29 00:37
 */
@Data
@EqualsAndHashCode(callSuper=false)
public class GenerateObservable extends ApplicationEvent {
    private String channel;
    private String id;
    private String code;
    private Duration codeEffectiveTime;
    private String imageBase64;
    /**
     * Create a new ApplicationEvent.
     *
     * @param source the object on which the event initially occurred (never {@code null})
     */
    public GenerateObservable(Object source, String id, String channel) {
        super(source);
        this.id = id;
        this.channel=channel;
    }
    @Override
    public GenerateReq getSource(){
        return (GenerateReq) super.getSource();
    }
}
